import api from "@/api";
import { PORT } from "../config/servicePort";

/**
 * 获取车辆列表
 */
export const getCarList = (data: any) => api.post(`${PORT}/api/dispatcher/vehicle/page`, data);

// 获取车辆详情
export const getCarDetail = (data: any) => api.post(`${PORT}/api/dispatcher/vehicle/detail/${data.id}`);

// 创建车辆
export const createCar = (data: any) => api.post(`${PORT}/api/dispatcher/vehicle/save`, data);

// 更新车辆
export const updateCar = (data: any) => api.post(`${PORT}/api/dispatcher/vehicle/update`, data);

// 车辆创建任务
export const createTaskByCar = (data: any) => api.post(`${PORT}/api/dispatcher/vehicle/createJob`, data);

// 删除车辆
export const deleteCar = (data: any) => api.post(`${PORT}/api/dispatcher/vehicle/delete/${data.id}`);


/**
 * 获取V2X列表
 */
export const getV2XList = (data: any) => api.post(`${PORT}/api/dispatcher/devices/page`, data);

// 获取V2X详情
export const getV2XDetail = (data: any) => api.post(`${PORT}/api/dispatcher/devices/detail/${data.id}`);

// 创建V2X
export const createV2X = (data: any) => api.post(`${PORT}/api/dispatcher/devices/save`, data);

// 更新V2X
export const updateV2X = (data: any) => api.post(`${PORT}/api/dispatcher/devices/update`, data);

// 删除V2X
export const deleteV2X = (data: any) => api.post(`${PORT}/api/dispatcher/devices/delete`, data);


